#ifndef MPHTTPREQUESTMESSAGEIMPL_H
#define MPHTTPREQUESTMESSAGEIMPL_H

/*****************************************
 * HttpRequestMessageImpl 继承于 HttpRequestMessage
 *****************************************/

#include "mpHttpRequestMessage.h"

namespace MP{
namespace HTTP{
namespace INTERNAL{

class HttpRequestMessageImpl : public HttpRequestMessage
{
public:
    HttpRequestMessageImpl(const std::string & uri,
                           MP::HTTP::HTTP_METHOD httpMethod);

    HttpRequestMessageImpl(const Url& uri,
                           MP::HTTP::HTTP_METHOD httpMethod);

    HttpRequestMessageImpl(const Url& baseAddress,
                           const std::string & relativeUri,
                           MP::HTTP::HTTP_METHOD httpMethod);

    virtual ~HttpRequestMessageImpl() override = default;
public:

    //获取或设置HTTP_METHOD
    virtual const std::string& getHttpMethod() const override;
    virtual void setHttpMethod(MP::HTTP::HTTP_METHOD httpMethod) override;
    //获取URL相关信息
    virtual const std::string& getScheme() const override;
    virtual const std::string& getHost() const override;
    virtual unsigned short getPort() const override;
    virtual const std::string& getRelativeUri() const override;
    //获取或设置HttpRequestHeaders
    virtual HttpRequestHeaders& getHttpRequestHeaders() override;
    //获取或设置SSL信息
    virtual SslSettings& getSslSettings() override;
    //获取或设置请求体
    virtual HttpRequestContent::ptr_s getHttpRequestContent() const override;
    virtual void setHttpRequestContent(HttpRequestContent::ptr_s requestContent) override;
    //生成请求头部Buffer
    virtual void getRequestHeaderBuffers(std::string& buf) override;
private:
    std::string _httpMethod;                            //请求方法
    Url _url;                                           //请求地址
    HttpRequestHeaders _httpHeaders;                    //请求Headers
    SslSettings _sslSettings;                           //ssl设置
    HttpRequestContent::ptr_s _requestContent;        //请求体

};  //HttpRequestContent


}   //INTERNAL
}   //HTTP
}   //MP


#endif // MPHTTPREQUESTMESSAGEIMPL_H
